Changeset 5971 for branches/newapi
- Timestamp:
- 12/31/07 09:03:01 (11 months ago)
- Location:
- branches/newapi/licq
- Files:
-
- 4 added
- 1 modified
-
cmake/Modules/BuildTypeCoverage.cmake (added)
-
cmake/Modules/DefineCompilerFlags.cmake (added)
-
cmake/Modules/DefineProjectDefaults.cmake (added)
-
cmake/Modules/DoxygenDocsTarget.cmake (added)
-
CMakeLists.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newapi/licq/CMakeLists.txt
r5820 r5971 8 8 include(DetermineDlopenBinding) 9 9 include(MacroEnsureVersion) 10 include(TestCXXAcceptsFlag)11 10 11 # Default settings 12 include(DefineProjectDefaults) 12 13 13 # Use DEBUG as default build type for now 14 if (NOT CMAKE_BUILD_TYPE) 15 set(CMAKE_BUILD_TYPE Debug CACHE STRING 16 "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Coverage." 17 FORCE) 18 endif (NOT CMAKE_BUILD_TYPE) 14 # Configure compiler flags 15 include(DefineCompilerFlags) 19 16 20 # Define DEBUG when doing debug builds. 21 set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG" CACHE STRING 22 "Flags used by the compiler during debug builds." FORCE) 23 set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG" CACHE STRING 24 "Flags used by the compiler during debug builds." FORCE) 17 # Adds a new build type: coverage 18 include(BuildTypeCoverage) 25 19 26 27 ################################################################################ 28 # Adds a new build type: coverage 29 ################################################################################ 30 31 set(CMAKE_CXX_FLAGS_COVERAGE "-g -DDEBUG -O0 -Wall -fprofile-arcs -ftest-coverage" 32 CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE) 33 34 set(CMAKE_C_FLAGS_COVERAGE "-g -DDEBUG -O0 -Wall -fprofile-arcs -ftest-coverage" 35 CACHE STRING "Flags used by the C compiler during coverage builds." FORCE) 36 37 set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "-fprofile-arcs -ftest-coverage" 38 CACHE STRING "Flags used for linking binaries during coverage builds." FORCE) 39 40 set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "-fprofile-arcs -ftest-coverage" 41 CACHE STRING "Flags used by the shared libraries linker during coverage builds." 42 FORCE) 43 44 mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE 45 CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE) 46 20 # Unit-test stuff 47 21 string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) 48 22 string(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "COVERAGE" UNIT_TESTS_COVERAGE) … … 56 30 endif (UNIT_TESTS_COVERAGE) 57 31 58 59 32 # Option to control building and running of unit-tests 60 33 option(BUILD_UNIT_TESTS "Build unit-tests" ON) … … 67 40 set(RUN_UNIT_TESTS OFF) 68 41 endif (BUILD_UNIT_TESTS) 69 70 71 # Don't link executable with -rpath72 SET(CMAKE_SKIP_RPATH ON)73 74 75 # Configure compiler flags76 check_cxx_accepts_flag(-Wall CXX_ACCEPTS_WALL)77 if (CXX_ACCEPTS_WALL)78 add_definitions(-Wall)79 endif (CXX_ACCEPTS_WALL)80 81 check_cxx_accepts_flag(-Wextra CXX_ACCEPTS_WEXTRA)82 if (CXX_ACCEPTS_WEXTRA)83 add_definitions(-Wextra)84 endif (CXX_ACCEPTS_WEXTRA)85 86 ## -fvisibility=hidden does not work with all boost libs yet87 # if (CMAKE_COMPILER_IS_GNUCXX)88 # check_cxx_accepts_flag(-fvisibility=hidden CXX_ACCEPTS_FVISIBILITY)89 # if (CXX_ACCEPTS_FVISIBILITY)90 # add_definitions(-fvisibility=hidden)91 # add_definitions(-DLICQ_HAVE_GCC_VISIBILITY)92 #93 # # Only add -fvisibility-inlines-hidden for g++ versions >= 4.294 # exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion95 # OUTPUT_VARIABLE gxx_version)96 # macro_ensure_version("4.2.0" "${gxx_version}" GXX_IS_NEWER_THAN_4_2)97 # if (GXX_IS_NEWER_THAN_4_2)98 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")99 # endif (GXX_IS_NEWER_THAN_4_2)100 # endif (CXX_ACCEPTS_FVISIBILITY)101 # endif (CMAKE_COMPILER_IS_GNUCXX)102 42 103 43 … … 146 86 check_function_exists(strerror HAVE_STRERROR) 147 87 148 149 88 # To find licq directory (public headers) 150 89 include_directories(BEFORE ${PROJECT_SOURCE_DIR}) … … 157 96 include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) 158 97 159 160 98 # Generate config.h 161 99 configure_file( … … 167 105 include(cmake/LicqVersion.cmake) 168 106 169 170 # Command to generate doxygen docs (make docs) 171 add_custom_target(docs 172 doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 173 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 174 COMMENT "Generating doxygen documentation" VERBATIM 175 ) 176 177 configure_file( 178 ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake 179 ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 180 @ONLY 181 ) 182 107 # Target to generate doxygen docs (make docs) 108 include(DoxygenDocsTarget) 183 109 184 110 add_subdirectory(bin)
